package com.smartrm.trade.domain.event;

import com.smartrm.globalinfrcore.event.DomainEvent;
import com.smartrm.trade.domain.OrderDO;
import com.smartrm.trade.domain.OrderType;

import java.math.BigDecimal;

/*
 * @program: common-starters
 * @description: 订单已创建领域事件
 * @author: houhong
 * @create: 2023-01-11 01:31
 */
public class OrderCreatedEvent extends DomainEvent {


    private long machineId;
    private long orderId;
    private OrderType orderType;
    private BigDecimal totalAmount;

    public OrderCreatedEvent(long machineId, OrderDO order) {
        super("trade.OrderCreatedEvent");
        this.machineId = machineId;
        this.orderId = order.getOrderId();
        this.orderType = order.getType();
        this.totalAmount = order.totalAmount();

    }

    @Override
    public String key() {
        return null;
    }
}